package com.example.datamanage.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.datamanage.common.Result;
import com.example.datamanage.pojo.Gather;
import com.example.datamanage.service.GatherService;
import com.example.datamanage.mapper.GatherMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 28142
* @description 针对表【gather】的数据库操作Service实现
* @createDate 2023-08-01 09:19:27
*/
@Service
public class GatherServiceImpl extends ServiceImpl<GatherMapper, Gather>
    implements GatherService{
    @Autowired
    private GatherMapper gatherMapper;

    @Override
    public Result findTablesByGather(Integer datasource, String chName, String enName, String gatherTime) {
        LambdaQueryWrapper<Gather> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(StrUtil.isNotBlank(chName), Gather::getChName, chName)
                .like(StrUtil.isNotBlank(enName), Gather::getEnName, enName)
                .gt(Gather::getGatherTime, gatherTime);
        return Result.success(gatherMapper.selectList(wrapper));
    }
}




